//
//  YSWebViewController.m
//  YSZC
//
//  Created by 张斌 on 16/4/25.
//  Copyright © 2016年 YueShiKeJi. All rights reserved.
//

#import "YSWebViewController.h"

@interface YSWebViewController ()<UIWebViewDelegate>

@end

@implementation YSWebViewController

-(void)loadView{
    
    self.view=[[UIWebView alloc] init];
    
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor=[UIColor redColor];
    
    //    self.navigationController.view.tintColor=[UIColor redColor];
    
    self.navigationItem.leftBarButtonItem=[[UIBarButtonItem alloc] initWithTitle:@"关闭" style:UIBarButtonItemStylePlain target:self action:@selector(closeclick)];
    
    // 创建webview
    UIWebView* webview=(UIWebView*)self.view;
    
    webview.delegate=self;
    
    NSURL* url=[[NSBundle mainBundle] URLForResource:@"help.html" withExtension:nil];
    
    //        NSURL * url = [NSURL URLWithString:@"http://www.baidu.com"];
    
    NSURLRequest* quest=[NSURLRequest requestWithURL:url];
    
    [webview loadRequest:quest];
    
    
    
}

-(void)closeclick{
    [self dismissViewControllerAnimated:YES completion:nil];
}

// webview的代理方法
//- (void)webViewDidFinishLoad:(UIWebView *)webView{
//    //拼接js代码
//    NSString * jsCode = [NSString stringWithFormat:@"document.location.href = '#%@';",self.model.BINid];
//    
//    [webView stringByEvaluatingJavaScriptFromString:jsCode];
//    
//    
//}

@end
